<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>jQuery.each(obj,callback)</title>
<meta name="keywords" content="jQuery 1.2 API Reference,Visual jQuery 1.2,jQuery doc,jQuery API,jQuery,jQuery 1.2 API 参考文档中文版,中文版" />
<meta name="description" content="jQuery 1.2 API 文档中文版，提供最新版 jQuery 开发帮助。" />
<link rel="stylesheet" type="text/css" href="../../style/jqueryapi.css" />
<script type="text/javascript" src="../../style/lib/jquery126.js"></script>
 </script>
<script type="text/javascript" src="../../style/jqueryapi.js"></script>
<link rel="shortcut icon" href="../../style/img/favicon.ico" />
</head>
<body>
<div id="topnav">
		<a href="http://www.jQuery.com/" title="jQuery官网" target="_blank" class="topnav">jQuery官网</a>
	<span class="topnav">|</span>
	<a href="http://jquery.org.cn/" title="jQuery中文网站" target="_blank" class="topnav">jQuery中文网站</a>
	<span class="topnav">|</span>
	<a href="http://www.cn-cuckoo.com/" title="1.1版译者" target="_blank" class="topnav">为之漫笔</a>
	<span class="topnav">|</span>
	<a href="http://shawphy.com/" title="1.2版翻译整理者" target="_blank" class="topnav">Shawphy</a>
    <span class="topnav">|</span>
	<a href="http://www.51toria.cn" title="CHM文档制作者:一揪" target="_blank" class="topnav">CHM文档制作者</a> 
	<span class="topnav">|</span>
	<a href="http://dl.getdropbox.com/u/81097/jQueryAPI_CHM.CHM" title="" target="_blank" class="topnav">CHM最新版本下载</a> 
</div>
<hr style="color:#595959;" />

<div class="content">
				<h1>jQuery.each(obj,callback)</h1>
				<div class="desc"><div>通用例遍方法，可用于例遍对象和数组。</div> <div class="longdesc">不同于例遍 jQuery 对象的 $().each() 方法，此方法可用于例遍任何对象。<p>回调函数拥有两个参数：第一个为对象的成员或数组的索引，第二个为对应变量或内容。</p>如果需要退出 each 循环可使回调函数返回 false，其它返回值将被忽略。</div></div>
				<hr />
				<div class="desc"><div>A generic iterator function, which can be used to seamlessly iterate over both objects and arrays.</div> <div class="longdesc">This function is not the same as $().each() - which is used to iterate, exclusively, over a jQuery object. This function can be used to iterate over anything. <p>The callback has two arguments:the key (objects) or index (arrays) as the first, and the value as the second. </p>If you wish to break the each() loop at a particular iteration you can do so by making your function return false. Other return values are ignored.</div></div>
				<h2>返回值</h2>
				<p class="indent">Object</p>
				<h2>参数</h2>
				<p class="indent"><strong>object </strong>(Object) : 需要例遍的对象或数组。</p>
				<p class="indent"><strong>callback </strong>(Function) : (可选) 每个成员/元素执行的回调函数。</p>
				<h2>示例</h2>
				<p class="indent">
					例遍数组，同时使用元素索引和内容。
				</p>
				<p class="indent"><strong>jQuery 代码:</strong></p>
				<div class="code">
					$.each( [0,1,2], function(i, n){<br/>
&nbsp; alert( "Item #" + i + ": " + n );<br/>
});
				</div>
				<hr />
				<p class="indent">
					例遍对象，同时使用成员名称和变量内容。 
				</p>
				<p class="indent"><strong>jQuery 代码:</strong></p>
				<div class="code">
					$.each( { name: "John", lang: "JS" }, function(i, n){<br/>
&nbsp; alert( "Name: " + i + ", Value: " + n );<br/>
});
				</div>
<p class="indent" style="text-align:center;">本手册由<a href="www.51toria.cn">一揪</a>整理编辑,并保持长期更新,最新版本请自行查找</p>
</div>

</body>
</html>
